import request from "@/utils/request.js";

// 获取用户详细信息
export function getUsage(params) {
  return request({
    url: "/parking/usage/",
    method: "get",
    params,
  });
}

// 获取详情
export const getUsageID = (id) => {
  return request({
    url: "/parking/usage/" + id,
    method: "get",
  });
};

// 获取详细信息
export function getCar(data) {
  return request({
    url: "/parking/index?community_code=" + data,
    method: "get",
  });
}

// 增加车位
export function postCar(data) {
  return request({
    url: "/parking/usage",
    method: "post",
    data,
  });
}

// 修改
export const putCar = (data) => {
  return request({
    url: "/parking/usage/" + data.id,
    method: "put",
    data,
  });
};

// 删除
export const delCar = (id) => {
  return request({
    url: "/parking/usage/" + id,
    method: "delete",
  });
};